
const Api = require('./api');

const {url} = require('./config')


const start = async ()=>{
	let list = await Api.getCatalogue(url)
	let imgList = await (async ()=>{
		let lists = []
		
		list.forEach((item, index)=>{
			(async ()=>{
				let li = await Api.getImages(item.href, index)
				lists = lists.concat(li)
				console.log(li)


			})()
		})

		console.log('lists',lists)

		return lists

	})()


	console.log('imgList', imgList)

	// Api.download(src, `${index+1}_${idx+1}_${title}`)


}

start()


// Api.saveFile(path.resolve(__dirname, './catalogue/catalogue.json'), JSON.stringify(catalogue))